<?php

namespace app\lib\resolution;

class Layzz
{
    protected $token = 'nczzlk-ckc--auther-chenjw5470';

    public function getDetail($link)
    {
        $param = [
            "link" => $link,
            "token" => $this->token
        ];

        $apiUrl = "http://parse.layzz.cn/lyz/platAnalyse";

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $apiUrl);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
        $output = curl_exec($ch);
        curl_close($ch);
        return $output;
    }
}
